{{- /*
Donation form.

@param {string} wallet YooMoney wallet.
@param {string} paypal PayPal user name.
@param {string} patreon Patreon user name.
@param {string} liberapay Liberapay user name.
@param {string} ko-fi KO-FI user name.
@param {string} buymeacoffee Buy Me a Coffee user name.
@param {string} usd USD bank card.
@param {string} eur EUR bank card.
@param {string} rub RUB bank card.
@param {string} btc BTC wallet.
@param {string} eth ETH wallet.
@param {string} xmr XMR wallet.

@returns {template.HTML}

@examples

  {{< form-donate
  wallet="0000000000000000"
  paypal="pp_username"
  patreon="patr_username"
  liberapay="lp_username"
  ko-fi="kf_username"
  buymeacoffee="bmc_username"
  usd="000 0000 0000 0000"
  eur="000 0000 0000 0000"
  rub="000 0000 0000 0000"
  btc="bc1q855dt7p8mtd74yw96vvu93wy59j0fl8gaqh62h"
  eth="0x7252D91B61E18eDE4c8ec43a0EE7F1dFD17542ab"
  xmr="48Q1zEztoECNyijSoQVhHC12LaxzNLPrhBgwGdM2847QY8ayusQ6XBjCD9hgeQk2LLUKbBvC5yKxDDmzkGvGyMGE9o95YkR" >}}
*/ -}}

{{- if (.IsNamedParams) -}}

    {{ $wallet := (.Get "wallet") }}
    {{ $paypal := (.Get "paypal") }}
    {{ $patreon := (.Get "patreon") }}
    {{ $liberapay := (.Get "liberapay") }}
    {{ $kofi := (.Get "ko-fi") }}
    {{ $buymeacoffee := (.Get "buymeacoffee") }}
    {{ $btc := (.Get "btc") }}
    {{ $eth := (.Get "eth") }}
    {{ $xmr := (.Get "xmr") }}
    {{ $usd := (.Get "usd") }}
    {{ $eur := (.Get "eur") }}
    {{ $rub := (.Get "rub") }}

    <div class="shortcode shortcode-form shortcode-{{ ($.Name) }} mb-3">
      <div class="row row-cols-1 g-3">
        <!-- yooMoney -->
          {{ if ($wallet) }}
            <div class="col">
              <div class="card">
                <h5 class="card-header">{{ (i18n "sc.form.donate.yoomoney") }}</h5>
                <div class="card-body">
                  <form method="post" action="https://yoomoney.ru/quickpay/confirm.xml">
                    <input type="hidden" name="receiver" value="{{ ($wallet) }}"/>
                    <input type="hidden" name="formcomment" value="Donation Form"/>
                    <input type="hidden" name="short-dest" value="Donation Form"/>
                    <input type="hidden" name="quickpay-form" value="donate"/>
                    <div class="row row-cols-1 row-cols-lg-2 g-3">
                      <div class="col">
                        <div class="row row-cols-1 g-3">
                          <div class="col">
                            <div class="input-group">
                              <span class="input-group-text"><i class="fas fa-coffee fa-fw"></i></span>
                              <input class="form-control" type="text" name="targets" placeholder='{{ (i18n "sc.form.donate.targets") }}' required/>
                            </div>
                            <small class="form-text text-body-secondary">{{ (i18n "sc.form.donate.targets_help") }}</small>
                          </div>
                          <div class="col">
                            <div class="input-group">
                              <span class="input-group-text"><i class="fas fa-ruble-sign fa-fw"></i></span>
                              <input class="form-control" type="number" name="sum" value="100" min="1"/>
                            </div>
                            <small class="form-text text-body-secondary">{{ (i18n "sc.form.donate.sum_help") }}</small>
                          </div>
                          <div class="col">
                            <div class="input-group">
                              <span class="input-group-text"><i class="far fa-credit-card fa-fw"></i></span>
                              <select class="form-select" name="paymentType">
                                <option value="AC">{{ (i18n "sc.form.donate.card") }}</option>
                                <option value="PC">{{ (i18n "sc.form.donate.yoomoney") }}</option>
                                <option value="MC">{{ (i18n "sc.form.donate.mobile_phone") }}</option>
                              </select>
                            </div>
                            <small class="form-text">{{ (i18n "sc.form.donate.payment_type_help") }}</small>
                          </div>
                          <div class="col">
                            <textarea class="form-control" name="comment" rows="2" maxlength="200"
                                      placeholder='{{ (i18n "sc.form.donate.comment_placeholder") }}'></textarea>
                            <small class="form-text">{{ (i18n "sc.form.donate.comment_help") }}</small>
                          </div>
                        </div>
                      </div>
                      <div class="col">
                        <div class="row row-cols-1 g-3">
                          <div class="col">
                            <div class="form-check">
                              <input class="form-check-input" type="checkbox" name="need-fio" id="ya-need-fio"/>
                              <label class="form-check-label" for="ya-need-fio">{{ (i18n "sc.form.donate.name") }}</label>
                              <div class="form-text">{{ (i18n "sc.form.donate.name_help") }}</div>
                            </div>
                          </div>
                          <div class="col">
                            <div class="form-check">
                              <input class="form-check-input" type="checkbox" name="need-email" id="ya-need-email"/>
                              <label class="form-check-label" for="ya-need-email">{{ (i18n "sc.form.donate.email") }}</label>
                              <div class="form-text">{{ (i18n "sc.form.donate.email_help") }}</div>
                            </div>
                          </div>
                          <div class="col">
                            <div class="form-check">
                              <input class="form-check-input" type="checkbox" name="need-phone" id="ya-need-phone"/>
                              <label class="form-check-label" for="ya-need-phone">{{ (i18n "sc.form.donate.phone") }}</label>
                              <div class="form-text">{{ (i18n "sc.form.donate.phone_help") }}</div>
                            </div>
                          </div>
                          <div class="col">
                            <div class="form-check">
                              <input class="form-check-input" type="checkbox" name="need-address" id="ya-need-address"/>
                              <label class="form-check-label" for="ya-need-address">{{ (i18n "sc.form.donate.address") }}</label>
                              <div class="form-text">{{ (i18n "sc.form.donate.address_help") }}</div>
                            </div>
                          </div>
                          <div class="col">
                            <div class="d-grid">
                              <button class="btn btn-primary is-label" type="submit">
                                <i class="fas fa-donate fa-fw me-2"></i>{{ (i18n "sc.form.donate.submit") }}
                              </button>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </form>
                </div>
              </div>
            </div>
          {{ end }}
        <!-- / yooMoney -->

        <!-- bank-card -->
          {{ if (or ($usd) ($eur) ($rub)) }}
            <div class="col">
              <div class="card">
                <h5 class="card-header">{{ (i18n "sc.form.donate.cards") }}</h5>
                <div class="card-body">
                  <div class="row g-3">
                      {{ if ($usd) }}
                        <div class="col-lg">
                          <div class="input-group">
                            <span class="input-group-text"><i class="far fa-credit-card fa-fw"></i></span>
                            <input class="form-control" type="text" value="{{ ($usd) }}" data-fn="select-all" readonly/>
                            <span class="input-group-text"><i class="fas fa-dollar-sign fa-fw"></i></span>
                          </div>
                        </div>
                      {{ end }}
                      {{ if ($eur) }}
                        <div class="col-lg">
                          <div class="input-group">
                            <span class="input-group-text"><i class="far fa-credit-card fa-fw"></i></span>
                            <input class="form-control" type="text" value="{{ ($eur) }}" data-fn="select-all" readonly/>
                            <span class="input-group-text"><i class="fas fa-euro-sign fa-fw"></i></span>
                          </div>
                        </div>
                      {{ end }}
                      {{ if ($rub) }}
                        <div class="col-lg">
                          <div class="input-group">
                            <span class="input-group-text"><i class="far fa-credit-card fa-fw"></i></span>
                            <input class="form-control" type="text" value="{{ ($rub) }}" data-fn="select-all" readonly/>
                            <span class="input-group-text"><i class="fas fa-ruble-sign fa-fw"></i></span>
                          </div>
                        </div>
                      {{ end }}
                  </div>
                </div>
              </div>
            </div>
          {{ end }}
        <!-- / bank-card -->

        <!-- services -->
          {{ if (or ($paypal) ($patreon) ($liberapay) ($kofi) ($buymeacoffee)) }}
            <div class="col">
              <div class="card">
                <h5 class="card-header">{{ (i18n "sc.form.donate.services") }}</h5>
                <div class="card-body">
                  <div class="row g-3 text-center">
                      {{ if ($paypal) }}
                        <div class="col-lg">
                          <h5 class="text-uppercase">{{ (i18n "sc.form.donate.paypal") }}</h5>
                          <a class="btn btn-secondary btn-lg btn-social d-block"
                             href="https://paypal.me/{{ ($paypal) }}" target="_blank"
                             data-bs-tooltip data-bs-title='{{ (i18n "sc.form.donate.paypal") }}'
                             rel="noopener nofollow" role="button"><i class="fab fa-paypal fa-fw"></i></a>
                        </div>
                      {{ end }}
                      {{ if ($patreon) }}
                        <div class="col-lg">
                          <h5 class="text-uppercase">{{ (i18n "sc.form.donate.patreon") }}</h5>
                          <a class="btn btn-secondary btn-lg btn-social d-block"
                             href="https://patreon.com/{{ ($patreon) }}" target="_blank"
                             data-bs-tooltip data-bs-title='{{ (i18n "sc.form.donate.patreon") }}'
                             rel="noopener nofollow" role="button"><i class="fab fa-patreon fa-fw"></i></a>
                        </div>
                      {{ end }}
                      {{ if ($liberapay) }}
                        <div class="col-lg">
                          <h5 class="text-uppercase">{{ (i18n "sc.form.donate.liberapay") }}</h5>
                          <a class="btn btn-secondary btn-lg btn-social d-block"
                             href="https://liberapay.com/{{ ($liberapay) }}" target="_blank"
                             data-bs-tooltip data-bs-title='{{ (i18n "sc.form.donate.liberapay") }}'
                             rel="noopener nofollow" role="button"><i class="fas fa-gift fa-fw"></i></a>
                        </div>
                      {{ end }}
                      {{ if ($kofi) }}
                        <div class="col-lg">
                          <h5 class="text-uppercase">{{ (i18n "sc.form.donate.kofi") }}</h5>
                          <a class="btn btn-secondary btn-lg btn-social d-block"
                             href="https://ko-fi.com/{{ ($kofi) }}" target="_blank"
                             data-bs-tooltip data-bs-title='{{ (i18n "sc.form.donate.kofi") }}'
                             rel="noopener nofollow" role="button"><i class="fas fa-coffee fa-fw"></i></a>
                        </div>
                      {{ end }}
                      {{ if ($buymeacoffee) }}
                        <div class="col-lg">
                          <h5 class="text-uppercase">{{ (i18n "sc.form.donate.buymeacoffee") }}</h5>
                          <a class="btn btn-secondary btn-lg btn-social d-block"
                             href="https://buymeacoffee.com/{{ ($buymeacoffee) }}" target="_blank"
                             data-bs-tooltip data-bs-title='{{ (i18n "sc.form.donate.buymeacoffee") }}'
                             rel="noopener nofollow" role="button"><i class="fas fa-coffee fa-fw"></i></a>
                        </div>
                      {{ end }}
                  </div>
                </div>
              </div>
            </div>
          {{ end }}
        <!-- / services -->

        <!-- crypto -->
          {{ if (or ($btc) ($eth) ($xmr)) }}
            <div class="col">
              <div class="card">
                <h5 class="card-header">{{ (i18n "sc.form.donate.crypto") }}</h5>
                <div class="card-body">
                  <div class="row g-3">
                      {{ if ($btc) }}
                        <div class="col-lg">
                          <div class="input-group mb-3">
                            <span class="input-group-text"><i class="fab fa-bitcoin fa-fw"></i></span>
                            <input class="form-control" type="text" value="{{ ($btc) }}" data-fn="select-all" readonly/>
                            <span class="input-group-text">{{ (i18n "sc.form.donate.btc") }}</span>
                          </div>
                          <div class="d-flex justify-content-center">
                            <div data-fn="qrcode" data-qr-text="{{ ($btc) }}"></div>
                          </div>
                        </div>
                      {{ end }}
                      {{ if ($eth) }}
                        <div class="col-lg">
                          <div class="input-group mb-3">
                            <span class="input-group-text"><i class="fab fa-ethereum fa-fw"></i></span>
                            <input class="form-control" type="text" value="{{ ($eth) }}" data-fn="select-all" readonly/>
                            <span class="input-group-text">{{ (i18n "sc.form.donate.eth") }}</span>
                          </div>
                          <div class="d-flex justify-content-center">
                            <div data-fn="qrcode" data-qr-text="{{ ($eth) }}"></div>
                          </div>
                        </div>
                      {{ end }}
                      {{ if ($xmr) }}
                        <div class="col-lg">
                          <div class="input-group mb-3">
                            <span class="input-group-text"><i class="fab fa-monero fa-fw"></i></span>
                            <input class="form-control" type="text" value="{{ ($xmr) }}" data-fn="select-all" readonly/>
                            <span class="input-group-text">{{ (i18n "sc.form.donate.xmr") }}</span>
                          </div>
                          <div class="d-flex justify-content-center">
                            <div data-fn="qrcode" data-qr-text="{{ ($xmr) }}"></div>
                          </div>
                        </div>
                      {{ end }}
                  </div>
                </div>
              </div>
            </div>
          {{ end }}
        <!-- / crypto -->

      </div>
    </div>

{{- else -}}

    {{ (partial "alerts/no_params" .) }}

{{- end -}}
